package com.qf.controller;

import com.qf.entity.RolePermissionDTO;
import com.qf.service.RoleService;
import com.qf.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/roles")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @PostMapping
    public R add(@RequestBody RolePermissionDTO dto) {
        roleService.addRoleAndPermission(dto);
        return R.success("角色和权限添加成功");
    }
}
